package edu.ahut.corejava2;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 从键盘上输入若干个整数，去掉重复元素后从小到大打印出来
 */
public class SortAndUniqueNumbers {
    public static void main(String[] args) {
        int[] a = new int[1];
        Scanner cin = new Scanner(System.in);
        int n = 0;
        while (cin.hasNext()) {
            if (n == a.length) {
                int[] b = new int[a.length * 2];
                for (int i = 0; i < a.length; i++) b[i] = a[i];
                a = b;
            }
            a[n++] = cin.nextInt();
        }
        cin.close();

        Arrays.sort(a, 0, n);

        System.out.print(a[0]);
        for (int i = 1; i < n; i++) {
            if (a[i] != a[i - 1]) {
                System.out.print(" " + a[i]);
            }
        }

    }

}
